<?php

/**
 * Ruta form.
 *
 * @package    SistemaRutasEc
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class RutaForm extends BaseRutaForm {

    protected static $subjects = array(0 => 'Ruta Cantonal',
        1 => 'Ruta Provincial',
        2 => 'Ruta Internacional');

    public function configure() {


        $this->useFields(array('salida', 'llegada', 'tipoRuta'));

       

        $this->setWidgets(array(
           
            'salida' => new sfWidgetFormInputText(),
            'llegada' => new sfWidgetFormInputText(),
            'tipoRuta' => new sfWidgetFormSelect(array('choices' => self::$subjects)),
        ));

        $this->setValidators(array(            
            'salida' => new sfValidatorString(array('max_length' => 255)),
            'llegada' => new sfValidatorString(array('max_length' => 255)),
            'tipoRuta' => new sfValidatorChoice(array('choices' => array_keys(self::$subjects))),
        ));
        $this->widgetSchema->setNameFormat('ruta[%s]');
        $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
    }

}
